<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

	<script type="text/javascript" src="js/jquery-1.5.1.js"></script>
	<script type="text/javascript">
		function deleteUser(id){
		
			$.ajax({
			async:"true",
			cache:"false",
			url:"${request.contextPath}/delete",
			data:{id:id},
			type:"post",
			dataType:"json",
			success:function(arr){
				$("#"+id).remove();
			}
			
			});
		}
	</script>
</head>
<body>
<a href="insert.ftl">添加</a>
	<table border='1' width='500px'>
	    <tr>
			<td>姓名：</td>
			<td>地址：</td>
			<td>邮箱:</td>
			<td colspan='2'>操作</td>
		<tr>
	<#list listUser.beanList as user>

		<tr id="${user.id}">
			<td>${user.name}</td>
			<td>${user.address}</td>
			<td>${user.email}</td>
			
			
		
			<td><a href="${request.contextPath}/edit?id=${user.id}">编辑</a></td>
			<td><input type="button" value="删除" onclick="deleteUser(${user.id})"/></td>
			
		<tr>
	</#list>
		<tr>
			
			

			<td colspan='5'>  
			
			<#if listUser.pc!=1 >
  				<a href="${listUser.url }?pc=1">首页</a>  
				<a href="${listUser.url }?pc=${listUser.pc-1}">上一页</a> 
		
		    </#if>
			<#if listUser.pc!=listUser.tp >
			 
				<a href="${listUser.url }?pc=${listUser.pc+1}">下一页</a>  
				<a href="${listUser.url }?pc=${listUser.tp}">末页</a></td>
			</#if>
		<tr>
	</table>
</body>
</html>
